import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '../views/HomePage.vue'
import ReaderPage from '../views/ReaderPage.vue'
import BookDetailPage from '../views/BookDetailPage.vue'

const routes = [
  {
    path: '/',
    name: 'HomePage',
    component: HomePage
  },
  {
    path: '/reader/:bookId?',
    name: 'ReaderPage',
    component: ReaderPage,
    props: true
  },
  {
    path: '/book/:bookId',
    name: 'BookDetailPage',
    component: BookDetailPage,
    props: true
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router

